package ru.dimka3210.java.reminder;

import com.tulskiy.keymaster.common.HotKey;
import com.tulskiy.keymaster.common.HotKeyListener;
import com.tulskiy.keymaster.common.Provider;
import ru.dimka3210.java.reminder.dialogs.InfoByRun;
import ru.dimka3210.java.reminder.frames.IndexFrame;
import ru.dimka3210.java.reminder.utils.Global;
import ru.dimka3210.java.reminder.utils.IsFirstRun;

import javax.swing.*;
import java.io.IOException;

/**
 * User: dimka3210
 * Date: 16.05.13
 * Time: 20:10
 */
public class Main {
    public static void main(String[] args) throws IOException {

        /**
         * I N I T
         */
        _init();
        /**
         * E N D   I N I T
         */

/*        Thread daemon = new Thread(new Daemon());
        daemon.start();*/
//        final IndexFrame indexFrame = IndexFrame.getInstance();

//        IndexFrame.getInstance().setVisible(true);


        final Provider provider = Provider.getCurrentProvider(true);

        provider.register(KeyStroke.getKeyStroke("control alt R"), new HotKeyListener() {
            public void onHotKey(HotKey hotKey) {
                if (!IndexFrame.getInstance().isVisible()) {
                    IndexFrame.getInstance().setVisible(true);
                }
            }
        });
/*
        HotKeyListener listener = new HotKeyListener() {
            public void onHotKey(HotKey hotKey) {
//                System.out.println(hotKey);
                if (!indexFrame.isVisible()) {
                    indexFrame.setVisible(true);
                }
                System.out.println("Line 55");
            }
        };*/
/*
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        String line = reader.readLine();

        if (line.equals(".")) {
            daemon.interrupt();
            System.exit(0);
        }*/
    }

    protected static void _init(){
        IndexFrame.getInstance();
        IsFirstRun.getInstance();
    }
}
